home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / ASM-ARM / IOMD.H < prev    next >
Encoding:
C/C++ Source or Header  |  1999-09-17  |  4.6 KB  |  181 lines

  1.  
  2. #ifndef __ASSEMBLER__
  3. #define __IOMD(offset)    (IO_IOMD_BASE + (offset >> 2))
  4. #else
  5. #define __IOMD(offset)    offset
  6. #endif
  7.  
  8. #define IOMD_CONTROL    __IOMD(0x000)
  9. #define IOMD_KARTTX    __IOMD(0x004)
  10. #define IOMD_KARTRX    __IOMD(0x004)
  11. #define IOMD_KCTRL    __IOMD(0x008)
  12.  
  13. #define IOMD_IRQSTATA    __IOMD(0x010)
  14. #define IOMD_IRQREQA    __IOMD(0x014)
  15. #define IOMD_IRQCLRA    __IOMD(0x014)
  16. #define IOMD_IRQMASKA    __IOMD(0x018)
  17.  
  18. #define IOMD_IRQSTATB    __IOMD(0x020)
  19. #define IOMD_IRQREQB    __IOMD(0x024)
  20. #define IOMD_IRQMASKB    __IOMD(0x028)
  21.  
  22. #define IOMD_FIQSTAT    __IOMD(0x030)
  23. #define IOMD_FIQREQ    __IOMD(0x034)
  24. #define IOMD_FIQMASK    __IOMD(0x038)
  25.  
  26. #define IOMD_T0CNTL    __IOMD(0x040)
  27. #define IOMD_T0LTCHL    __IOMD(0x040)
  28. #define IOMD_T0CNTH    __IOMD(0x044)
  29. #define IOMD_T0LTCHH    __IOMD(0x044)
  30. #define IOMD_T0GO    __IOMD(0x048)
  31. #define IOMD_T0LATCH    __IOMD(0x04c)
  32.  
  33. #define IOMD_T1CNTL    __IOMD(0x050)
  34. #define IOMD_T1LTCHL    __IOMD(0x050)
  35. #define IOMD_T1CNTH    __IOMD(0x054)
  36. #define IOMD_T1LTCHH    __IOMD(0x054)
  37. #define IOMD_T1GO    __IOMD(0x058)
  38. #define IOMD_T1LATCH    __IOMD(0x05c)
  39.  
  40. #define IOMD_ROMCR0    __IOMD(0x080)
  41. #define IOMD_ROMCR1    __IOMD(0x084)
  42. #define IOMD_DRAMCR    __IOMD(0x088)
  43. #define IOMD_VREFCR    __IOMD(0x08C)
  44.  
  45. #define IOMD_FSIZE    __IOMD(0x090)
  46. #define IOMD_ID0    __IOMD(0x094)
  47. #define IOMD_ID1    __IOMD(0x098)
  48. #define IOMD_VERSION    __IOMD(0x09C)
  49.  
  50. #define IOMD_MOUSEX    __IOMD(0x0A0)
  51. #define IOMD_MOUSEY    __IOMD(0x0A4)
  52.  
  53. #define IOMD_DMATCR    __IOMD(0x0C0)
  54. #define IOMD_IOTCR    __IOMD(0x0C4)
  55. #define IOMD_ECTCR    __IOMD(0x0C8)
  56. #define IOMD_DMAEXT    __IOMD(0x0CC)
  57.  
  58. #define DMA_EXT_IO0    1
  59. #define DMA_EXT_IO1    2
  60. #define DMA_EXT_IO2    4
  61. #define DMA_EXT_IO3    8
  62.  
  63. #define IOMD_IO0CURA    __IOMD(0x100)
  64. #define IOMD_IO0ENDA    __IOMD(0x104)
  65. #define IOMD_IO0CURB    __IOMD(0x108)
  66. #define IOMD_IO0ENDB    __IOMD(0x10C)
  67. #define IOMD_IO0CR    __IOMD(0x110)
  68. #define IOMD_IO0ST    __IOMD(0x114)
  69.  
  70. #define IOMD_IO1CURA    __IOMD(0x120)
  71. #define IOMD_IO1ENDA    __IOMD(0x124)
  72. #define IOMD_IO1CURB    __IOMD(0x128)
  73. #define IOMD_IO1ENDB    __IOMD(0x12C)
  74. #define IOMD_IO1CR    __IOMD(0x130)
  75. #define IOMD_IO1ST    __IOMD(0x134)
  76.  
  77. #define IOMD_IO2CURA    __IOMD(0x140)
  78. #define IOMD_IO2ENDA    __IOMD(0x144)
  79. #define IOMD_IO2CURB    __IOMD(0x148)
  80. #define IOMD_IO2ENDB    __IOMD(0x14C)
  81. #define IOMD_IO2CR    __IOMD(0x150)
  82. #define IOMD_IO2ST    __IOMD(0x154)
  83.  
  84. #define IOMD_IO3CURA    __IOMD(0x160)
  85. #define IOMD_IO3ENDA    __IOMD(0x164)
  86. #define IOMD_IO3CURB    __IOMD(0x168)
  87. #define IOMD_IO3ENDB    __IOMD(0x16C)
  88. #define IOMD_IO3CR    __IOMD(0x170)
  89. #define IOMD_IO3ST    __IOMD(0x174)
  90.  
  91. #define IOMD_SD0CURA    __IOMD(0x180)
  92. #define IOMD_SD0ENDA    __IOMD(0x184)
  93. #define IOMD_SD0CURB    __IOMD(0x188)
  94. #define IOMD_SD0ENDB    __IOMD(0x18C)
  95. #define IOMD_SD0CR    __IOMD(0x190)
  96. #define IOMD_SD0ST    __IOMD(0x194)
  97.  
  98. #define IOMD_SD1CURA    __IOMD(0x1A0)
  99. #define IOMD_SD1ENDA    __IOMD(0x1A4)
  100. #define IOMD_SD1CURB    __IOMD(0x1A8)
  101. #define IOMD_SD1ENDB    __IOMD(0x1AC)
  102. #define IOMD_SD1CR    __IOMD(0x1B0)
  103. #define IOMD_SD1ST    __IOMD(0x1B4)
  104.  
  105. #define IOMD_CURSCUR    __IOMD(0x1C0)
  106. #define IOMD_CURSINIT    __IOMD(0x1C4)
  107.  
  108. #define IOMD_VIDCUR    __IOMD(0x1D0)
  109. #define IOMD_VIDEND    __IOMD(0x1D4)
  110. #define IOMD_VIDSTART    __IOMD(0x1D8)
  111. #define IOMD_VIDINIT    __IOMD(0x1DC)
  112. #define IOMD_VIDCR    __IOMD(0x1E0)
  113.  
  114. #define IOMD_DMASTAT    __IOMD(0x1F0)
  115. #define IOMD_DMAREQ    __IOMD(0x1F4)
  116. #define IOMD_DMAMASK    __IOMD(0x1F8)
  117.  
  118. #define DMA_END_S    (1 << 31)
  119. #define DMA_END_L    (1 << 30)
  120.  
  121. #define DMA_CR_C    0x80
  122. #define DMA_CR_D    0x40
  123. #define DMA_CR_E    0x20
  124.  
  125. #define DMA_ST_OFL    4
  126. #define DMA_ST_INT    2
  127. #define DMA_ST_AB    1
  128. /*
  129.  * IOC compatability
  130.  */
  131. #define IOC_CONTROL    IOMD_CONTROL
  132. #define IOC_IRQSTATA    IOMD_IRQSTATA
  133. #define IOC_IRQREQA    IOMD_IRQREQA
  134. #define IOC_IRQCLRA    IOMD_IRQCLRA
  135. #define IOC_IRQMASKA    IOMD_IRQMASKA
  136.  
  137. #define IOC_IRQSTATB    IOMD_IRQSTATB
  138. #define IOC_IRQREQB    IOMD_IRQREQB
  139. #define IOC_IRQMASKB    IOMD_IRQMASKB
  140.  
  141. #define IOC_FIQSTAT    IOMD_FIQSTAT
  142. #define IOC_FIQREQ    IOMD_FIQREQ
  143. #define IOC_FIQMASK    IOMD_FIQMASK
  144.  
  145. #define IOC_T0CNTL    IOMD_T0CNTL
  146. #define IOC_T0LTCHL    IOMD_T0LTCHL
  147. #define IOC_T0CNTH    IOMD_T0CNTH
  148. #define IOC_T0LTCHH    IOMD_T0LTCHH
  149. #define IOC_T0GO    IOMD_T0GO
  150. #define IOC_T0LATCH    IOMD_T0LATCH
  151.  
  152. #define IOC_T1CNTL    IOMD_T1CNTL
  153. #define IOC_T1LTCHL    IOMD_T1LTCHL
  154. #define IOC_T1CNTH    IOMD_T1CNTH
  155. #define IOC_T1LTCHH    IOMD_T1LTCHH
  156. #define IOC_T1GO    IOMD_T1GO
  157. #define IOC_T1LATCH    IOMD_T1LATCH
  158.  
  159. /*
  160.  * DMA (MEMC) compatability
  161.  */
  162. #define HALF_SAM    vram_half_sam
  163. #define VDMA_ALIGNMENT    (HALF_SAM * 2)
  164. #define VDMA_XFERSIZE    (HALF_SAM)
  165. #define VDMA_INIT    IOMD_VIDINIT
  166. #define VDMA_START    IOMD_VIDSTART
  167. #define VDMA_END    IOMD_VIDEND
  168.  
  169. #ifndef __ASSEMBLER__
  170. extern unsigned int vram_half_sam;
  171. #define video_set_dma(start,end,offset)                \
  172. do {                                \
  173.     outl (SCREEN_START + start, VDMA_START);        \
  174.     outl (SCREEN_START + end - VDMA_XFERSIZE, VDMA_END);    \
  175.     if (offset >= end - VDMA_XFERSIZE)            \
  176.         offset |= 0x40000000;                \
  177.     outl (SCREEN_START + offset, VDMA_INIT);        \
  178. } while (0)
  179. #endif
  180.  
  181.